//
//  BigScrollView.m
//  UI06_homework
//
//  Created by dllo on 16/6/13.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BigScrollView.h"
#import "ScrollView.h"
@implementation BigScrollView

-(void)dealloc{
    
//    [_edgeScrollView release];
    [super dealloc];
    
}




-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
//        self.edgeScrollView = [NSArray array];
        [self setPropertys];
    }
    return self;
}

-(void)setPropertys{
    // 不显示水平和垂直的滑动条
    self.showsVerticalScrollIndicator = NO;
    self.showsHorizontalScrollIndicator = NO;
    
    // 设置分页效果;
    self.pagingEnabled = YES;
    
}

-(void)addPictures:(NSArray<ScrollView *> *)scrollImageArray{
    self.contentSize = CGSizeMake(CGRectGetWidth(self.bounds) * scrollImageArray.count, 0);
    
    ScrollView * imageView = [[ScrollView alloc]init ];
        for (int i = 0; i < scrollImageArray.count; i ++) {
        
        imageView = scrollImageArray[i];
        imageView.frame = CGRectMake(i * CGRectGetWidth(self.bounds), 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds));
        [self addSubview:imageView];
        [imageView release];
        
    }
    
//    //添加边缘的
//    NSMutableArray *edge = [NSMutableArray arrayWithArray:scrollImageArray];
//    [edge insertObject:scrollImageArray.lastObject atIndex:0];
//    [edge addObject:scrollImageArray[0]];
//    self.contentSize = CGSizeMake(CGRectGetWidth(self.bounds) * edge.count, 0);
    

}


@end
